
# https://www.w3.org/TR/vc-data-model/
from typing import Optional
from pydantic import BaseModel  # 常用的用于数据接口schema定义与检查的库 （https://blog.csdn.net/codename_cys/article/details/107675748）


vc_context = ["https://www.w3.org/2018/credentials/v1"]


class Credential(BaseModel):
    id: str
    type: Optional[object]  # string或string数组
    issuer: Optional[str]
    issuanceDate: Optional[str]  # "2010-01-01T19:23:24Z"
    credentialSubject: Optional[object]  # 对应CPT，丰富多变
    nonTransferable: Optional[bool]
    # 目前规范不规定特定的proof格式，取决于交互策略、内容、验证方法等细节
    # RsaSignature2018,Ed25519Signature2020,CLSignature2019,AnonCredDerivedCredentialv1,都不一样
    proof: Optional[object]
